package come.tool.JDialog;

import com.tool.role.RoleData;
import org.come.Frame.ZhuFrame;
import org.come.Jpanel.ZhuJpanel;
import org.come.entity.RoleSummoning;
import org.come.mouslisten.ChangeMouseSymbolMouslisten;

public class DecomposeJDialog implements TiShiChuLi
{
    @Override
    public void tipBox(final boolean tishi, final Object object) {
        if (tishi) {
            if (object instanceof RoleSummoning) {
                final RoleSummoning pet = (RoleSummoning)object;
                if (pet.getPetlock() == 1) {
                    ZhuFrame.getZhuJpanel().addPrompt("该召唤兽已加锁，不能放生。。");
                }
                else {
                    if (pet.getGoods() != null) {
                        ZhuFrame.getZhuJpanel().addPrompt("该召唤兽携带着装备");
                    }
                    else {
                        if (ZhuJpanel.getPetMount(pet.getSid()) != null) {
                            ZhuFrame.getZhuJpanel().addPrompt2("这只召唤兽被管制中，不可放生！！！");
                        }
                        else {
                            if (RoleData.getRoleData().getLoginResult().getSummoning_id() != null && RoleData.getRoleData().getLoginResult().getSummoning_id().compareTo(pet.getSid()) == 0) {
                                ZhuFrame.getZhuJpanel().addPrompt2("这只召唤兽已在参战中！！！");
                            }
                            else {
                                ChangeMouseSymbolMouslisten.decomposePet(pet);
                            }
                        }
                    }
                }
            }
        }
    }
}
